package gamagora.game.utils
{
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	
	import gamagora.game.resources.OSImages;

	public class Utils
	{
		private static const ERO_1:BitmapData = (new OSImages.EROSION1 as Bitmap).bitmapData;
		private static const ERO_2:BitmapData = (new OSImages.EROSION2 as Bitmap).bitmapData;
		private static const ERO_3:BitmapData = (new OSImages.EROSION3 as Bitmap).bitmapData;
		private static const ERO_4:BitmapData = (new OSImages.EROSION4 as Bitmap).bitmapData;
		private static const ERO_5:BitmapData = (new OSImages.EROSION5 as Bitmap).bitmapData;
		private static const ERO_6:BitmapData = (new OSImages.EROSION6 as Bitmap).bitmapData;
		private static const ERO_7:BitmapData = (new OSImages.EROSION7 as Bitmap).bitmapData;
		private static const ERO_8:BitmapData = (new OSImages.EROSION8 as Bitmap).bitmapData;
		private static const ERO_9:BitmapData = (new OSImages.EROSION9 as Bitmap).bitmapData;
		private static const ERO_10:BitmapData = (new OSImages.EROSION10 as Bitmap).bitmapData;
		private static const ERO_11:BitmapData = (new OSImages.EROSION11 as Bitmap).bitmapData;
		private static const ERO_12:BitmapData = (new OSImages.EROSION12 as Bitmap).bitmapData;
		private static const ERO_13:BitmapData = (new OSImages.EROSION13 as Bitmap).bitmapData;
		private static const ERO_14:BitmapData = (new OSImages.EROSION14 as Bitmap).bitmapData;
		private static const ERO_15:BitmapData = (new OSImages.EROSION15 as Bitmap).bitmapData;
		
		public static function getRandomFruit():Class
		{
			switch(uint(Math.random() * 3))
			{
				case 0:
					return OSImages.ORANGE;
				case 1:
					return OSImages.RED;
				case 2:
					return OSImages.YELLOW;
				default:
					return OSImages.BALL;
			}
		}
		
		public static function getRandomErodedBorder():BitmapData
		{
			switch(uint(Math.random() * 15))
			{
				case 0:
					return ERO_1;
				case 1:
					return ERO_2;
				case 2:
					return ERO_3;
				case 3:
					return ERO_4;
				case 4:
					return ERO_5;
				case 5:
					return ERO_6;
				case 6:
					return ERO_7;
				case 7:
					return ERO_8;
				case 8:
					return ERO_9;
				case 9:
					return ERO_10;
				case 10:
					return ERO_11;
				case 11:
					return ERO_12;
				case 12:
					return ERO_13;
				case 13:
					return ERO_14;
				case 14:
					return ERO_15;
				default:
					return ERO_1;
			}
		}
	}
}
